<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 遍历循环 forEach
      const arr = ["red", "green", "pink"];
      const result = arr.forEach((item, index) => {
        console.log(item); // 数组元素 red green pink
        console.log(index); // 元素下标索引
      });
    </script>
  </body>
</html>
